class People {
  name: string;
  age: number;
  // 构造函数不能添加返回值，否则会报错
  constructor(name: string, age: number) {
    this.name = name;
    this.age = age;
  }
}

const p1 = new People('张三', 18);
console.log(p1);